In most existing panoramic technologies, optimization is performed for a horizontal direction. When shooting a panorama in the horizontal direction, a user smoothly moves a camera and shoots a frame of photo every a particular angle, and a wide panorama image may be generated through stitching. Although a stitched image may generate a particular geometric deformation, the deformation is not obvious because a shooting scene is usually far and a view is relatively wide.
However, when a panorama image is shot in a vertical direction, such as a skyscraper or a tall tree, the camera needs to be moved in the vertical direction to shoot multiple frames of photos at different angles. Then the multiple frames of photos are merged using an algorithm in order to generate the panorama image. However, a result of merging the multiple frames of photos shot in this manner may generally have different degrees of geometric deformation and distortion.
FIG. 1 is a schematic diagram of an image distortion generation principle when a panorama image is shot in a vertical direction. As shown in FIG. 1, for example, a mobile phone 20 is used to shoot a relatively tall building 10. Point O is a location (which is also a location of an optical center) of a camera of the mobile phone 20, and point C and point D are respectively a lowest point and a highest point that can be shot when the camera of the mobile phone 20 is used to shoot the building 10 at a particular angle. In FIG. 1, c (i.e, distance OE) is a projection of a distance value of point C to the optical center O onto an optical axis (shown by a dashed line OF in FIG. 1) direction, and d (i.e, distance OF) is a projection of a distance value of point D to the optical center O onto the optical axis direction. It can be seen from FIG. 1 that in a shooting process, in order to shoot the top of the building 10, the camera of the mobile phone 20 is not used to directly shoot the building 10 in the vertical direction, but is rotated upwards by a particular angle when being moved upwards, and the angle may be represented by ∠COD.
It should be noted that in FIG. 1, the building 10 is actually only a cross-section side view, that is, the entire building 10 is viewed as a straight line from the side. In a front view, any point on the building 10 may refer to any point in a particular line of the image. For example, point C in FIG. 1 may refer to any point in a line of the lowest end in the image. Point D may refer to any point in the line of the uppermost end in the image. Moreover, in other locations of the text, if a particular point on the building 10 is indicated, explanations are the same as those described above, and details are not described herein again.
Because of existence of a rotation angle, the optical axis of the camera in the mobile phone 20 is not perpendicular to a plane of the building 10. Therefore, within a range of a vertical perspective ∠COD of the camera, projections of distance values of points at different heights of an imaging plane of the building 10 to the optical center O onto the optical axis direction are not equal (for example, in FIG. 1, a projected distance value d>c). Therefore, when a highest point of the building 10 shot by the mobile phone 20 at this included angle is point D, a height of a formed image is less than a height of a formed image of the shot building 10 whose highest point is point C. If these photos are merged, severe image deformation is inevitably caused, and an image effect is distorted severely.
FIG. 2 is an effect diagram after the distorted images are merged. As shown in FIG. 2, after the distorted images are merged, in the merged image, vertical lines bend, or the top contracts towards the middle, causing severe impact on visual experience of a user.